﻿<#-- 
 
 crea una extension para la clase para c# para la tabla  ${table}...
 basicamente para su uso como objectDataSource ...
 Author : Luis Molina...
 
 -->
<#-- variables used internally by the generator... -->
<#assign nameFile="${table}">
<#assign extensionFile="cs">
<#assign languageGenerated="c#">
<#assign description="c#">
<#assign targetDirectory="">
<#assign appliesToAllTables="true">
<#-- END variables used internally by the generator... -->
 
' devuelve un arraylist simple de ${table} 
    Public Shared Function getArrayPacientesAsString(ByVal ${table.getKey()} As String) As String()
        Dim db As New dbClass(ctes.conStringAdo)
        Dim sql As String
        Dim reg As Object
        Dim alist As New ArrayList

        Try
            sql = "select p.${table.getKey()} from ${table} p where p.${table.getKey()}=" & ${table.getKey()}
            reg = db.sql(sql)
            Do While reg.read()
                alist.Add(reg("${table.getKey()}").ToString)
            Loop
            reg.close()
        Catch ex As Exception
        Finally
            db.dispose()
        End Try
        Return CType(alist.ToArray(GetType(String)), String())
    End Function
 

 
 